package com.fattyCorps.common.packet.hero.component.skill.component;

import cn.hutool.extra.spring.SpringUtil;
import com.fattyCorps.common.mgr.Cfg;
import com.fattyCorps.common.obj.config.HeroMould;
import com.fattyCorps.common.obj.config.SkillMould;
import com.fattyCorps.common.packet.hero.component.skill.HeroSkill;
import com.fattyCorps.common.packet.hero.Hero;
import com.fattyCorps.common.packet.hero.component.Component;

import java.util.List;

public abstract class ABaseSkillComponent implements Component.IComponent {
    protected Hero hero;
    protected HeroSkill owner;
    protected HeroMould heroMould;

    protected Cfg cfg;

    @Override
    public void onCreate(Object owner) {
        this.owner = (HeroSkill) owner;
        hero = this.owner.getOwner();

        cfg = SpringUtil.getBean(Cfg.class);
        heroMould = cfg.getCfg(HeroMould.class, hero.getTypeId());
    }

    public abstract List<SkillMould> getSkills();
}
